|
Generated by JDiff |
|||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | ||||||||
This file contains all the changes in documentation in the packageorg.globalplatformas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
This interface definesClass Application, void processData(byte[], short, short)thea method through which an Application may forward input data to another Application.This
interfacethatshallrepresentsbe implemented by anapplet method accessible throughApplication that wishes tothereceive personalizationOPEN to thedata forwarded byapplication'sits associated Security Domain.This interfaceInmust besuch aimplementedscenario,byif theAppletApplicationclass that willimplements both theuseApplicationtheand theadditionalPersonalizationfunctionalityinterface,allowing athen the Security Domainto pass datashalltouse theappletPersonalization interface.@see Personalization
@since export file version 1.0
ThisProcessesmethod processesapplication specific data received from anotherentityonthe-card entity.If
this other entity is thethe Application invoking this methodApplication'sisassociateda Security Domain,thisthendatait shall be assumed that:is
- The
baBufferbyte arraythea globalAPDUbytebuffer.array;Notes:DuringThethe invocation the Java Card VM performsdata forwarded by the Security Domain is acontextSTOREswitchDATA command.TheTheapplicationsOffsetis responsible forparameter locates themanagingclass byte of the command and thesLengthparameter indicates theatomicitylength ofitstheownentire command (i.e. header + data field).AsAny exception thrown by this methodcanwill beinvokedrethrown bya Securitythe Security Domain,immaterialhenceofwill be converted to and returned as a response status word to theApplicationoff-cardLifeentity.CycleIfState,theitexception is an ISOException, then theresponsibilitystatusofword will be theapplet to ensurereason code of thatitsexception.currentOtherwise,Life Cycle State isa status word ofvalid'6F00'forwill be returned.Notes:
this
- Upon invocation of
operationmethod, the Java Card VM performs a context switch.As the appletApplication is not the currently selectedapplicationApplication,itit should notuseattempt to access transient memory ofthetypeCLEAR_ON_DESELECTwhenduringcreatingthetransientprocessing of thisarraysmethod.If the method throws anThe Application is responsible forISOExceptionmanaging theJavaCard runtime environment sendsatomic modification of its ownthedata,associatedifreasonneeded.codeAs as the response statusthis method may beinstead.invokedIf the Exception thrown does not extendsby a Security Domain immaterial of theISOExceptionApplication's internal state, thereason code usApplication is responsibleISO7816.SW_UNKNOWN.forensuringThethat its internal statepersonalizationis validsession remains openfor this operation.@param baBufferthe sourcebyte array containingtheinput data.expected by theMust be aappletglobal byte array.This@parambuffersOffsetmustbeoffsetglobalof input data withinbaBuffer. @paramsOffsetsLengthstartingoffsetlength of input data.within@exception SecurityException ifbaBuffersourceis not a global byte array. @param sLengthexception NullPointerExceptionlengthifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading input data would cause access of data outside array bounds.
This interfaceClass Authority, void init(byte)provides services to recoverallows performing operations suchaas recovering a cryptographic keyand toorsignsigning data. TheCASD shall publish this interface to the OPEN, using Global Service interface, to make itsrequiredservices available to other Applicationsalgorithms and credentials are known implicitly.The
APSDIt istheintendedfirst entity requiring this service from the CASD asthat Security Domains would be able to access anshownAuthorityininstance2.1.throughThere is only one CASD inside thea Global Service by a Controlling Authoritycard.SecurityTheDomain (CASDshall register this service)aswith aunique Global Service with theservicefamily identifiername=#83#of(.per sectionGPSystem.FAMILY_AUTHORITY<8.1.3 of GlobalPlatform Card Specification v2.2|0x00)
The Authority interface is responsible@sincefor
signing- export
and verifyingfile versionmessage1.2:withinitialaversion.key- export
implicitly knownfile version 1.6:Thereviewed overallimplementerdescription of this interfacehas the knowledge of the keys used for the different operations.@since export file version 1.2
Initializes the Authority interface with the appropriate mode (Class Authority, short recoverKey(byte[], short, short, byte[], short)MODE_SIGNorMODE_KEY_RECOVERY). @param theMode one of .MODE_SIGN or .MODE_KEY_RECOVERY. @exception CryptoExceptionwith the following reason code:
ILLEGUAL_VALUEif theMode option is anundefinedundefined value.
Recovers a cryptographic key from a set of data structures provided in the input buffer (inBuff). As a mandatory step, the recovery mechanism includes the verification of the origin and integrity of the recovered key. This method knows, from the set of data structures present in the input buffer, which recovery mechanism is to be used. The recovered key is written in the ouput buffer (outBuff) at specified offset (outOffset), in the form of a key data structure whose format depends on the type of the key. A call to this method resets this instance of the Authority interface to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to recover another key. The input and output buffers may overlap and shall be global arrays. @param inBuff containing input data. @param inOffset offset of input data. @param inLength length of input data. @param outBuff the buffer where recovered key data structure shall be written @param outOffset offset where recovered key data structure shall be written @returnClass Authority, short sign(byte[], short, short, byte[], short)Lengthof the recovered key data structure written in outBuff at outOffset,or 0 if the recovery mechanism failed (e.g. recovered key was considered invalid). @throws CryptoException - with the following reason codes:@throws SecurityException if the inBuff or outBuff are not global
INVALID_INITif this Authority interface is not initialized orinitializedinitialized inMODE_SIGNmode.arrayarrays.
Generates the signature of all/last input data. A call to this method resets this Authority interface to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to sign another message. The input and output buffer may overlap and shall be global arrays. @param inBuff the input buffer of data to be signed @param inOffset the offset in input buffer at which the signature starts @param inLength the byte length to sign @param sigBuff the output buffer to store signature data @param sigOffset the offset into sigBuff at which to begin signature generation @return the number of bytes of signature output in sigBuff @throws CryptoException with the following reason codes:Class Authority, void update(byte[], short, short)@throws SecurityException if the inBuff or sigBuff are not global
INVALID_INITif this Authority interface is not initialized or initialized inMODE_KEY_RECOVERYmode.ILLEGAL_USEif this Authority algorithm does not pad the message and the message is not block aligned.arrayarrays.
Accumulates input data. for the current operation (Class Authority, byte MODE_KEY_RECOVERYMODE_SIGNorMODE_KEY_RECOVERY).When this method is used, temporary storage of intermediate results is required. This method should only be used if all the input data required for the current operation is not available in one byte array. The
signorrecoverKeymethods are recommended whenever possible. The inBuff shall be global array. @param inBuff buffer containing input data @param inOffset offset of input data @param inLength length of input data @throws CryptoException with the following reason codes:@throws SecurityException if the inBuff is not global array.
INVALID_INITif this Authority interface is not initialized.
UsedClass Authority, byte MODE_SIGNinwith .init()methodsmethod to indicate key recovery mode.
Usedinwith .init()methodsmethod to indicatesignature signsigning mode.
This interface definesClass CVM, boolean blockState()thebasicinterfaceCardholder Verification Method services (e.g. comparison of CVM value, CVM state query). It is typically exposed to on-card Applications by a Global Services Application implementing oneoror more Cardholder VerificationMethodsMethods.ThisSome servicesclass offers basic Cardholder Verification Method servicesare restricted to Applications having the CVM(eManagement Privilege.gTo retrieve an instance of this interface, an Application shall invoke the GPSystem.getCVM method, or shall use a GlobalService instance of the GPSystem.FAMILY_CVM family. For
verificationbackward compatibility, the CVMstateinstancesinterrogation)retrievedtousinganythe GPSystem.getCVM method are mapped onto those retrieved as Global Services of theApplicationsGPSystem.FAMILY_CVM family.
presentTheonCVM instance maintains thecardfollowing data (see Card Specification v2.2.1 section 8.2.2 for more details):,
- CVM state: ACTIVE, INVALID_SUBMISSION
while someVALIDATED orofBLOCKED. In addition, we distinguish theservicescase where the CVM instance is not fully initialized (ei.ge.unblockeither the CVM,change CVMvalue orvaluethe CVM try limit has not been set)are restricted to Applicationsand has never enteredwiththe state ACTIVE.CVM try limit: theprivilege to changemaximum value of the CVMvaluestry counter.PriorCVM totryusingcounter:thistheinterface, annumberApplication is required to obtain a handle toof unsuccessful comparisons of the CVM value thatthemay be performed before this CVMservicesinstance gets blocked.TheCVM value: the secret value held by this CVM applicationinstance,shall exposestored intheASCII, BCD or HEX format. Operations performed byGlobalServicethis interfaceobjectshall be independent of, and not interfere with, any transaction in progress (s)e.g. ifthroughtheapplet.getShareableInterfaceObject()verifyaccordingmethodtois invoked from within a transaction and thisspecification.transaction is aborted, then the try counter is not revert to its original value).@since
export file version 1.0: initial version.
- export file version 1.6: reviewed overall description of this interface.
Class CVM, byte getTriesRemaining()ThisSets the CVM state to BLOCKED.If the Application invoking this
methodsetsdoes not have the CVM Management Privilege, then the CVM state is not updated.The CVM state can only be set
to BLOCKED if the CVM instance already entered the state ACTIVE once, that is, if the CVM instance is fully initialized. Notice that this method shall returntrueif the CVM state is already BLOCKED.Notes:
@return
The CVM application shall verify the CVM Management privilege usingIf the Global Service Application providing this CVM instance has theGPRegistryEntryGlobalinterfaceRegistry Privilege, it isofable to check that the Application invokingapplet.thismethod has the CVM Management Privilege using the GPRegistryEntry interface;trueif the CVM state was set to BLOCKED,falseotherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, boolean isActive()ThisGetsmethod returnsthenumber ofCVM trytriescounter,remainingthatforis, theCVM. Thisnumberindicates the numberof unsuccessful comparisons oftimesthe CVM valuecanthat may beincorrectly presented prior to the CVMperformed before this CVM instance getsreachingblocked.
the@returnstatecurrent value ofBLOCKED.the@returnCVMTries remainingtry counter.
Class CVM, boolean isBlocked()ThisIndicatesmethod indicateswhetherthethis CVM instance is active, that is, whether it has been fullypresentinitialized (i.e. both value and try limit) andactivatedis ready for use.Ifactiveyes, then the CVMcouldstate is deemed to be inanyone ofthethe following states: ACTIVE, INVALID_SUBMISSION,VALIDATED or BLOCKED.@return
trueif the CVMstate ishas been(atfullyleast)initializedACTIVEand is ready for use,falseotherwise (i.e. the CVM state is NOT_READY).
Class CVM, boolean isSubmitted()ThisIndicatesmethodwhether this CVM instance is blocked,indicatesthat is, whether theCVM is currentlyCVM state is BLOCKED.@return
trueif the CVM state is BLOCKED,falseotherwise.
Class CVM, boolean isVerified()ThisIndicatesmethod indicateswhether an attempt has been made to compare the CVM value. Note: This method does,notthatdifferentiateis, whether the CVMvalue has beenstatesuccessfullyisverifiedINVALID_SUBMISSION ornot, i.e. CVM states ofVALIDATEDor INVALID_SUBMISSION.@return
trueif the CVM state is(atINVALID_SUBMISSIONleast)orSUBMITTEDVALIDATED,falseotherwise.
Class CVM, boolean resetAndUnblockState()ThisIndicatesmethod indicateswhether a successful comparison of the CVM value has occurred, that is, whether the(CVMstate ofstate is VALIDATED).@return
trueif the CVM state is VALIDATED,falseotherwise.
Class CVM, boolean resetState()ThisResets the CVM state to ACTIVE, even if it is currently BLOCKED.If the Application invoking this
methodresetsdoes not have the CVM Management Privilege, then the CVM statefromisBLOCKEDnot updated.The CVM state can only be set to ACTIVE
.Notes:ifThethe CVMApplication shall verifyinstance already entered the state ACTIVE once, that is, if the CVMManagement privilege usinginstance is fullyinitialized. If theGPRegistryEntryCVMinterfacestate is successfully reset, then this method also resets the CVM try counterofto theinvokingCVMapplet;try limit.Notes:
TheIf the Global Service Application providing this CVMtryinstancecounterhas the Global Registry Privilege, it isresetable to check that the Applicationwheninvoking this methodunblockinghas the CVM.Management Privilege using the GPRegistryEntry interface;@returntrueif the CVM state was reset to ACTIVE,falseotherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, boolean setTryLimit(byte)ThisResetsmethod resetsthe CVM state to ACTIVE.
Notes:Thestate of theCVM state can only besetreset to ACTIVE from the states ACTIVE, INVALID_SUBMISSION or VALIDATED.TheIn particular, it cannot be reset to ACTIVE if it is in stateofBLOCKED or if the CVMcannot be set toinstance never entered the state ACTIVE,fromthatBLOCKED.is,if the CVM instance is not fully initialized.
@returntrueif the CVM state was reset,falseotherwise.
Class CVM, boolean update(byte[], short, byte, byte)This methodSets thesetsCVM try limit, that is, the maximumnumbervalue oftries forthe CVM.try counter.
Notes:TheIfCVMthe Applicationshallinvoking this method does notverifyhave the CVMManagement privilegeManagementusingPrivilege,then theGPRegistryEntryCVMinterface of the invokingtry limit is notapplet;set.
TheIf the CVM trycounterlimit isresetsuccessfullywhen settingset,the maximum number ofthen this method alsotries;resetsThethe CVMstate istryresetcounter toACTIVEthe newwhenCVM try limit.changingIf themaximumCVMnumber ofvalue hastries.alreadyWhen setting thebeen successfully setmaximumpreviously,number ofthen thistriesmethod alsobefore(re)sets theCVMCVM stateisto ACTIVE,.Notes:
If the Global Service Application providing this CVM stateinstancehas the Global Registry Privilege, it istransitionsable toACTIVEcheckonlythatifthe Application invoking this method has the CVMvalue is alreadyManagement Privilege usingset.the GPRegistryEntry interface;@param bTryLimit the maximum number of tries for the CVM.@returntrueif themaximum number oftrytrieslimit was set,falseotherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, short verify(byte[], short, byte, byte)ThisUpdatesmethod changesthe CVM value.
Notes:TheIfCVMthe Applicationshall verifyinvokingthe CVM Management privilege usingthis method does not have theGPRegistryEntryCVMinterfaceManagementofPrivilege,the invokingor ifapplet;theThespecifiedinvokingformatapplet(bFormat) isresponsible for specifying the formatunknownof(orthe CVMnot supportedvalue;byThethis CVMRetry Counter is resetinstance),when changingor if the new CVM value;TheisCVM state is resetnot consistent with respect toACTIVEthe specifiedwhenformat,changingthen the CVM value.is not updated.When settingIf the CVM valuebefore the CVMisstate issuccessfully updatedACTIVE,and the CVMstate transitions to ACTIVE only iftry limit has already been successfully setthepreviously,Retry Limit is alreadythen this method alsoset;resets theDataCVMpresented always replacestry counter to theprevious dataCVMregardlesstryoflimit,itsandformat(re)setsorthe CVMlength.stateThetoCVMACTIVE.
shallNotes:
rememberIf the format, length,Globaland value of theService Application providing this CVMdata.instanceThe CVM mayhas the Global(orRegistry Privilege,mayitnot)isdo editing checks onable to check that thedataApplicationandinvoking this methodrejecthas the CVMupdateManagementif the dataPrivilege using thefailsGPRegistryEntrytheinterface;editingThe checksCVM(e.g.instancereject data thatshall record theisformat,presentedlength,as BCD that is notand value of the CVMnumerical)value.@param baBufferthe sourcebyte array containing the new CVM value.This bufferMustmustbe a global byte array. @param sOffsettheoffset of the new CVM value withinsource byte arraybaBuffer. @param bLengththelength of the new CVM value. @param bFormattheformat of the new CVM value: .FORMAT_ASCII, .FORMAT_BCD or .FORMAT_HEX. @returntrueif the CVM value waschangedsuccessfully updated,falseotherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT @exception SecurityException ifbaBufferis not a global byte array. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading the new CVM value would cause access of data outside array bounds.
Class CVM, byte FORMAT_ASCIIThisComparesmethoda valuecompareswith the stored CVM value.
withIf theoneCVMpassed asstate isparameter.BLOCKED,Notes:orIfif thevalue passedsubmittedasformatparameter(bFormat) isnot inunknownthe(orsame format as thenot supported by this CVMvalueinstance),the value passed as parameter mustor if this method throws abeNullPointerExceptionconverted prioror antoArrayIndexOutOfBoundsException,comparingthen the comparison is deemed unsuccessful.If
HEXtheformatsubmitted CVM value ispresented for CVM verification and ASCII or BCDnot in the same format as the stored CVM value, then formatwas used for updatingconversion shall occur according to theCVMfollowingvalue,rulesthe comparisonprior tofails;comparing values:
If HEX format is presented for CVM verificationsubmitted andHEX format was used for updating the CVM valuethe stored CVM value is in ASCII or BCD format,the comparisonthensucceeds when the lengththe conversion cannot occur and thedatacomparisonvalue match exactlyis deemed unsuccessful;If BCD or ASCII format is presented forsubmittedCVM verification and HEX format was usedand the stored CVM value is in HEXforformat,updatingthen theCVMconversionvalue,cannot occur and the comparisonfailsis deemed unsuccessful;If ASCII format is presentedsubmitted and theforstored CVMverificationvalueandisBCDin BCD format,was used for updatingthen conversion can occur if the submitted CVM value,the comparison failsonly contains numericalifASCII characters: theASCIInumeric characterspresented(codedforon oneverificationbyte)are not all numericalof the submitted value(zeroare converted tonine).numericnibbles,If all thepadded together inASCIIbytes,characters areand anumerical,paddingformatnibbleconversion'F' isoccurs andadded on thecomparisonrightsucceedsif necessary.whenOtherwise, thelengthconversion cannot occur and thedata value match exactlycomparison is deemed unsuccessful;If BCD format is presentedsubmitted and theforstored CVMverificationvalueandisASCIIin ASCII format,was used forthen conversion can occurupdatingif the stored CVM value,only contains numerical ASCII characters: thecomparison fails ifnumeric nibbles of theCVMsubmitted valuecontainsarenon-numericalexpandedASCIItothe corresponding characters.Ifcoded on one byte and theCVM valuepadding nibblecontains'F'only numericalis deletedASCII(ifcharacterspresent). Otherwise,formatthe conversionoccurscannotoccur and the comparisonsucceedsis deemed unsuccessful;whenIf thelengthcomparison is unsuccessful and thedata value matchCVM state isexactly;notIfBLOCKED, then thecomparison isCVM trysuccessfulcounter must be decremented (by 1). In this case, if the CVM try countermustreaches a value of '0' then the CVM state shall bereset andset to BLOCKED, otherwise the CVMstate muststate shall be set toVALIDATEDINVALID_SUBMISSION.If the comparison is
unsuccessfulsuccessful, then the CVM try countermustshall beupdatedreset to the CVM try limit andthethe CVM statemustshall be set toINVALID_SUBMISSIONVALIDATED.The
Retry Counter objectCVM try counter and the CVMstates VALIDATED and INVALID_SUBMISSIONstate shall not conformto atransactiontransaction in progress, i.e. they shall not revert to a previous value ifaa transaction in progress is aborted; If the maximum number of tries has been reached, the CVM state must be set to BLOCKED.
@param baBufferthe sourcebyte array containing the submitted CVM value.This buffer mustMust be a global byte array. @param sOffsettheoffset of the submitted CVM value withinsource byte arraybaBuffer. @param bLengththelength of the submitted CVM value. @param bFormattheformat of the submitted CVM value: .FORMAT_ASCII, .FORMAT_BCD or .FORMAT_HEX. @returnvalue indicating.CVM_SUCCESSwhetherif the comparison was successful,or.CVM_FAILURE otherwise. @exception SecurityException ifbaBufferis not a global byte array.Values@exceptionother thanNullPointerException ifCVM_SUCCESSbaBuffer(0)isornull.CVM_FAILURE@exception(-1)ArrayIndexOutOfBoundsExceptionareif reading the submitted CVMReservedvalue would cause access of datafor Future Useoutside array bounds.
The CVM value is formatted as ASCII bytes.Class CVM, byte FORMAT_BCDNote:
- If the CVM value is stored in a format other than ASCII, it is the
responsibilityresponsibility of the interface to convert to theexpectedexpected format.
The CVM value is formatted as numerical digits, coded on a nibble (4 bits) and left justified.Class CVM, byte FORMAT_HEXNote:
- If the CVM value is stored in a format other than BCD, it is the responsibility
ofof the interface to convert to theexpectedexpected format.- If the length of the CVM value is odd, the right most nibble
ofof the CVMvaluevalue shall be high values ('F').
The CVM value is formatted as hexadecimal (binary) data.Note:
- If the CVM value is stored in a format other than HEX, it is the responsibility of
thethe interface to convert to theexpectedexpected format.
ThisClass GPRegistryEntry, void deregisterService(short)defines the interface correspondinginterface allows querying andtopotentially modifying theGPRegistryEntry of a singleregistry data of an Application.The Global Serviceregistered within the GlobalPlatformApplicationRegistry.
usesEverythisGPRegistryEntryinterfaceinstance tocheckanthe validity ofApplication registered within therequestGlobalPlatformpresentedRegistry.
byTo retrieve anon-card entity. Prior toinstanceusingof this interface, an Applicationis requiredshallto obtain a handle toinvokethetheGPRegistryEntryGPSystem.getRegistryEntryofmethod.
an@since
Application by- export
invoking thefile versionGPSystem1.getRegistryEntry()1:method.initial version.@since- export file version 1.
16: reviewed overall description of this interface.
Class GPRegistryEntry, AID getAID()This method allowsDeregisters a serviceaname.
Global Services ApplicationThe OPEN shall(e.g.checka CVMthat the Application)invoking this method corresponds toderegisterthisaentry, that it has the Global Service Privilege, and that the specified service name was previously uniquely registered by that same Application.If not, this method shall throw an exception (see below).
Notes:The@paramOPENsServiceName the servicechecksname thattheshall be deregistered.A service
requestingname is encoded on-cardentity2hasbytes, theGlobal Service Privilege1st byte identifying a family of services andis associated with this registrythe 2nd byte identifying a serviceentry;within that family.The
OPENGPSystemchecksclassthatdefines a set of constantsFAMILY_XXX(of thebytetype) that may be used to build a service nameis(ofregisteredtheshorttype) suitable to invoke this method asunique forshown in therequestingfollowingon-cardexamples:
(short)((GPSystem.FAMILY_CVM<8)|0x11)entity(short)((GPSystem.FAMILY_HTTP_ADMINISTRATION<8)|0x00)@paramexceptionsServiceName the uniqueISOException if thisservicemethod is not supported or if the service name was not found or if the conditions allowing to deregister the service name are not satisfied.@exceptionseeISOException#registerServicewith@seetheGPSystem#FAMILY_CVMfollowing@seereasonGPSystem#FAMILY_SECURE_CHANNELcode:@seeGPSystem#FAMILY_USSMISO7816.SW@see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_CONDITIONSHTTP_ADMINISTRATION @see GPSystem#FAMILY_NOTHTTP_SATISFIEDREPORT
Class GPRegistryEntry, short getPrivileges(byte[], short)ThisGetsmethod returnstheApplication'sAIDregistered in the current GlobalPlatform Registry's entry. Notes: TheofOPEN checks that the requesting on-card entity hastheGlobal Service Privilege and is associatedApplicationwithcorresponding tothisentryregistry; The OPEN checks that the service name is.registered@returnasAIDunique forinstance identifying therequesting on-card entity.Application@returncorrespondingthetoAIDthisobjectentry.
Class GPRegistryEntry, byte getState()ThisGetsmethod returns allthePrivileges bytesPrivilegeregistered inBytes of thecurrentApplicationGlobalPlatform registrycorresponding tothisentry.@param baBufferThebyte array where PrivilegesbytesBytesare toshall bestoredwritten. @param sOffsetTheoffsetinwithinbaBufferatwhich to begin the Privileges byteswhere Privileges Bytes shall be written.@returnsOffset+Lengthnumber ofthePrivilegePrivilegesBytes written tobaBuffer.@exceptionArrayIndexOutOfBoundsExceptionSecurityException ifstoringbaBufferis not accessible in thePrivilegescaller's context e.g.bytesbaBufferiswouldnot a globalcause access outsidearray nor an arrayboundsbelongingorto thesOffsetcaller context. @exception NullPointerException ifbaBufferisnegativenull. @exception ArrayIndexOutOfBoundsException if writing Privileges Bytes would cause access of data outside array bounds.
Class GPRegistryEntry, boolean isAssociated(AID)ThisGetsmethod returnsthe Life Cycle Stateregistered inof thecurrent GlobalPlatform RegistryApplication corresponding tothisentry.@returnThethe Life Cycle Stateas defined in sectionof the Application corresponding11.11tothisentry.
Class GPRegistryEntry, boolean isPrivileged(byte)ThisChecksmethod allows towhetherverify if the entitythe Application corresponding towhosethisAID is provided inentry is associated with theinputspecifiedparametersSecurityisDomain.
registered as the associated Security Domain ofThe OPEN shall check that the specifiedthissdAIDGPRegistryEntry.indeedNotes:identifiesTheaOPEN determines ifSecurity Domain present on theSDAIDcard,is registered inand check thatthethe Applicationcurrent GlobalPlatformcorresponding toRegistry'sthisentryas the associatedis associated with this Security Domain.If not, this method shall returnfalse.@param
SDAID objectsdAID AID ofthe investigateda Security Domain.@returnTruetrueif theGP RegistryApplicationreferencescorrespondingthe SecuritytoDomainthisas beingentry is associated withthis GPRegistryEntry, orthe specified Security Domain,Falsefalseotherwise.
Class GPRegistryEntry, void registerService(short)ThisChecksmethod allowswhetheranthe Application(e.g. a CVM Application)corresponding toverify if a given Privilege isthisregistered in this GPRegistryEntryentry has the specified(e.gprivilege.
checkIf theCVMspecifiedManagementprivilegeof anotherisApplicationunknown,invoking thethis method shallCVM.update()returnmethod)false.@param bPrivilege the privilege number toverifycheck,asi.e. onedefined inof theTablePRIVILEGE_XXX6-1constants.@returnTruetrueifat leastthereferenced Privilege is registered inApplicationthe GPcorresponding toRegistrythisentry, orhasFalse ifthereferenced Privilege is not registered in thespecifiedGPprivilege,Registryfalseentryotherwise.
Class GPRegistryEntry, boolean setState(byte)ThisRegistersmethoda service nameallowsidentifying aGlobalserviceServices Applicationprovided by(e.gthe Application corresponding tothisentry.
a CVMTheApplicationspecified service name (sServiceName)to registershall beaunique amonguniqueall the serviceidentifiernames previouslywithinregistered in theGlobalPlatformGlobalPlatform Registry using this method. Following successful invocation of this method,Notesthis service name is known to be uniquely registered:no other Application on the card will be able to register the same service name (until this service name is deregistered (see .deregisterService)). If the service name identifies a family of service, no other Application on the card will be able to register a service of that family.The OPEN
checksshall first check that therequestingApplication invokingon-cardthis methodentitycorresponds tothisentry and that it has the GlobalServiceService Privilege.
and is associatedThen the OPENshall checkwiththat thecurrentspecified service name:GlobalPlatform Registry
- is not already uniquely registered in the
entry;TheifOPEN checks thatthe service name identifies an entire family of services, then therequestedOPEN shall check that no serviceidentifiername of that family is registered.was previously recorded for the Application matches withcorresponding tothisentry (onei.e. specified as part of System Install Parameters in the INSTALL command). If any of theServiceabove conditions is not satisfied, this method shall throw an exceptionParameter(ssee below).Otherwise,recordedthe specified service name shall be uniquely registered in thecurrentGlobalPlatform Registry.
entry;@paramThesServiceNameOPENthe servicechecksname thattheshall be uniquely registered.A
serviceidentifiername isnotencodedalready registeredon 2asbytes,unique by any otherthe 1st byte identifyingentrya family of servicesinand theGlobalPlatform2ndRegistrybyte identifying a service within that family.If@paramthesServiceName2nd byte is set to0x00, the caller of this method is registering an entire family of service.The GPSystem class defines a
set of constantsFAMILY_XXX(of theuniquebytetype) that may be used to build a service name (of theshorttype) suitable toregisterinvoke this method as shown in the following examples:.
(short)((GPSystemFAMILY_CVM<8)|0x11)@exception ISOException (short)((GPSystem.FAMILY_HTTP_ADMINISTRATION<8)|0x00)withif this method is not supported or if the conditions allowing to register thefollowing reasonservice namecode:arenotISO7816satisfied.SW@see #deregisterService @see GPSystem#getService @see GPSystem#FAMILY_CONDITIONSCVM @see GPSystem#FAMILY_NOTSECURE_SATISFIEDCHANNEL @see GPSystem#FAMILY_USSM @see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_HTTP_ADMINISTRATION @see GPSystem#FAMILY_HTTP_REPORT
Sets the Life Cycle state of the Application corresponding tothisentry.This method
allowsenforces the Life CyclestateStateof this GPRegistryEntry totransition rules described inbeCard Specification v2.2.1 section 5.If
thisentrytransitionedcorresponds to the Issuer Security Domain (ISD), then the OPEN shall check that the requestedtargettransition compliesstatewith Card Life Cycle State transition rules.If needed, the OPEN shall check that the Application invoking this method has the Card Lock Privilege or the Card Terminate Privilege.
NotesOtherwise, the following rules shall apply:
AIftransitionthisrequestentry corresponds to a Security Domain, then the OPEN shall check that the requested transition complies with Security Domains' Life Cycle StateINSTALLEDtransitionshallrules.be- If
rejected;thisentry does not correspond to a Security Domain,Athen the OPEN shall check the requested transitionrequestcompliestowith Applications' Life Cycle State transition rules.- If this method is invoked to transition an Application (or Security Domain) from the INSTALLED
stateother thanto theAPPLICATION_LOCKEDSELECTABLEandstate,APPLICATION_UNLOCKEDthenthe request shall beacceptedrejected.onlyif- If the
invoking Applicationhigh order bitcorresponds(b8) ofbStateis set tothis1,GPRegistryEntry;thenAntheApplicationcall to this method shall beableinterpreted as an attempt to lockand shallan Applicationnot(orbeSecurity Domain),able toand otherunlockbits ofitself;bStateshall be ignored (b7-b1).OnlyIfthisentry corresponds to an Applicationwith(or SecurityGlobalLockDomain)privilegethatoris currenly locked, then only thedirectly or indirectlyhigh order bitassociated(b8)SecurityofDomainbStateofshall be taken into account and, if it is set to 0 then the call to thisGPRegistryEntrymethod shall beableinterpreted as an attempt tolockunlock the Application (orunlockSecuritythisDomain).GPRegistryOtherEntry;bits ofbStateshall be ignored (b7-b1).ThisIf this method is invoked to lock or unlock an Application (or Security Domain), then the OPEN shallfail ifcheck thatthisthe Application invoking this methodGPRegsitryEntryeither corresponds tothisentry or has theIssuer Security DomainGlobal Lock Privilege.@param bState thetargetnewstateLife Cycle State. See Card Specification v2.2.1 section 11.1.1 forthisdetails on Life CycleGPRegistryEntryState Coding.@returnATruevalue ofifGPSystem.APPLICATION_LOCKEDthe(resp.transition0x00)ismaysuccessful,be used to request locking (resp. unlocking) an Application or a Security Domain (other thanorthe ISD). @returntrueif the transition was successful,Falsefalseotherwise.
Class GPSystem, CVM getCVM(byte)The GPSystemThis class exposes a subset of the behavior of the OPEN to the outside world. The OPEN implements and enforces a Card Issuer's security policy relating to these services.This OPEN classIt provides functionality at the same level as the JCRE, i.e. the "system" context with special privileges.This class is composed of static methods visible to all applets importing the globalplatform package.@since
- export file version 1.0: initial version.
- export file version 1.1: new services and/or constants added.
- export file version 1.3: new services and/or constants added.
- export file version 1.5: new services and/or constants added.
- export file version 1.6: reviewed overall description of this interface.
Class GPSystem, byte getCardContentState()ThisGetsmethoda referencereturnsto ahandleCVMtoinstance provided by theCVMOPEN.
interfaceSince export file version 1.1,thisNotesmethod allows looking up for CVM instances registered as Global Services by so-called Global Services Applications (i.e. Applications having the Global Service Privilege) and the following mechanism is defined to retrieve such instances:For backward compatibility, the .CVM_GLOBAL_PIN
- The OPEN
searcheslooks up in the GlobalPlatform Registry forthe CVMa Global Services Applicationthat(i.e.hashaving the GlobalServiceServiceprivilegePrivilege)and is uniquelythat registered aregisteredGlobal Service with the specifiedFAMILY_CVMbCVMIdentifierand thisidentifier for thebCVMIdentifier.FAMILY_CVM family, oristhat uniquelyregistered a Global Service for the entire .FAMILY_CVM;family.- The OPEN
invokes thethen retrievesApplet.getShareableInterfaceObject()themethodcorrespondingofGlobalServicethe corresponding CVM Applicationinstance by invoking the Applet.OPENgetShareableInterfaceObjectprovides the following parameters to themethod of that Global Services ApplicationApplet.getShareableInterfaceObject()withmethod:the#clientAID#isparameter set to the AID ofthethe current applet context (i.e. therequestingoneon-cardinvoking thisentitymethod) and#theparameter# isparameter settoto .GLOBAL_SERVICE_IDENTIFIER;.- The
CVM Application returns theOPENreference of thethen retrieves a ShareableInterface Object implementinginstance by invoking theGlobalService interface. OPEN invokes theGlobalService.getServiceInterface()methodwith the followingwithparameters:the#GPRegistryEntry#clientRegistryEntryisparameter set to the GPRegistryEntryinterfaceinstance of the currentappletapplet context (i.e. therequestingoneon-cardinvokingentitythis method), with the#sServiceName#first byte issettoto(.FAMILY_CVM, theand second byte to<8|bCVMIdentifier)baBufferisparameter set tonull,(indicating no buffer)and thesOffset andsLengthset to zeroare;.TheFinally,CVM Application returnsthe OPEN casts thereferenceretrieved Shareable instance to the CVM interface before returning it.- If any of the
Shareableabove steps fails,Interface Object implementingthe requested CVMinstance is deemed to be unavailable.interfaceconstantcorrespondingcan still be used to access a Global Service registered with theidentifier, or uniquely registered for the entire .FAMILY_CVM family.bCVMIdentifier(.FAMILY_CVM<8|.CVM_GLOBAL_PIN)Whether suchThis handlea service isthenavailablereturned by OPENor not stilltodepends on therequestingissuer'sappletpolicy.@param bCVMIdentifier identifies therequiredrequested CVMinterfaceinstance.@returntherequested CVMinterface objectinstance,reference.ornullifthere is no matchingtheCVM Interface in the GlobalPlatform Registryrequested CVM instance is not available.@see #CVM_GLOBAL_PIN
Class GPSystem, byte getCardState()ThisGetsmethod returnsthe Life Cycle State of the current applet context.Notes: The OPEN locates the entry of the current applet context in the Open Platform Registry and retrieves the Life Cycle State.
@return the Life Cycle State of the current applet context.@see #APPLICATION_INSTALLED,INSTALLED @see #APPLICATION_SELECTABLE,SELECTABLESECURITY_DOMAIN@see #APPLICATION_PERSONALIZEDLOCKED
Class GPSystem, GPRegistryEntry getRegistryEntry(AID)ThisGetsmethod returnsthe Life Cycle State of the card.
@return the Life Cycle State of thecardcard. @see #CARD_OP_READY,READY @see #CARD_INITIALIZED,INITIALIZED @see #CARD_SECURED,SECURED @see #CARD_LOCKED,LOCKED @see #CARD_TERMINATED
Gets a GPRegistryEntry instance.Class GPSystem, SecureChannel getSecureChannel()This method allows
anthe Application(e.g.associatedawith the currentCVM)applet context toaccess the GPget its ownRegistryGPRegistryEntryentryinstanceofor the one of another Application.Ifno AID istheinput,aidthis method providesparameter is notthenullGP Registry entry ofand does not identify therequestingApplication. It returnsa handleinvoking thistomethod, theGPRegistryEntry interface.OPENNotes:shallThecheckOPEN verifies that the requesting Applicationthat the Application invoking this method has the Global RegistryprivilegePrivilege. If not,or isthis method shallthereturnnull.@param
Security Domain associated withaid the AID of the Applicationbeing investigated,whose GPRegistryEntryorinstance istherequested.investigatedUseApplicationnullitself.toretrievethe@paramGPRegistryEntryreqAID identifiesinstance of therequiredcurrentGPRegistryEntry interfaceapplet context.@returnThe GPRegistryEntry interface reference corresponding totheinput AID,requestedorGPRegistryEntrynullinstance ifthere isitno Application inwas found in theGPGlobalPlatform Registrythat corresponds toand theinput AID or if theApplicationrequesting Application is not authorizedinvoking this method is allowed to accessthe corresponding GP Registrythat entry. @see,AIDnullotherwise. @since export file version 1.1
Class GPSystem, GlobalService getService(AID, short)This method returnsGets ahandle to theSecureChannelinterfaceinstance.
Notes: TheOPENThis methodlocatesallows theentryApplicationofassociated with the currentappletapplet contextin thetoOpen Platformretrieve aRegistrySecureChannelto determine theinstance provided byapplication'sits associated Security Domain.Since export file version 1.1
,Thisalthough not required, this method maybebe implemented usingathesimilar mechanismGlobal Serviceasfacility,described for thein which casegetCVMSecureChannelmethodinstances would be registered by Security Domains as Global Services.In this case, Security Domains shallcheck that they only provide such SecureChannel instances to their associated Applications.
@return the SecureChannel interface object reference. @see #getCVM the GPSystem.getCVM() method for an example of how to access a Global Service.
Class GPSystem, boolean lockCard()This methodGets areturnsGlobalServicea handleinstance matchingtothe specified service name (sServiceName).The
toserverAIDparameter is optional (i.e. may be setnull) and identifies the Global ServicesinterfaceApplication providingoftheaservice.The OPEN shall look for
the Global Services Application.providingNotesthe service:
TheIf theserverAIDparameter isoptional:null,ifthennotthe OPENknownshallbylook for therequestingspecifiedon-cardserviceentity,nameit isamong the settoofnull;uniquelyTheregisteredsServiceNameserviceparameternamesis(seemandatoryGPRegistryEntry.registerService).WhenIf theserverAIDrequestedisservice name only identifiesNulla family of services,thethen the OPENsearchesshall look for a uniquely registered service name of theGlobalPlatform Registryrequested familyfor(the search strategy remains implementation dependent). If a matching service name is found, the Global Services Applicationcorresponding to thisisuniquethesServiceNameoneor to this entirethat uniquely registered that servicefamilyname.- Otherwise,
Whenif theserverAIDparameter isnotnotnull, then the OPENchecks thatshall look in thesServiceNameGlobalPlatform Registry for the corresponding Application:
- If the Application does not have the Global Service Privilege, then
orthe search is deemed tothisbe unsuccessful.entire- If the requested service name (or family
isof service) was not previously recorded for that Application (i.e. not specified as part of System Install Parameters in theGPINSTALLRegistrycommand),for thisthen theserverAID;searchOPENisinvokestheAppletdeemed to be unsuccessful.getShareableInterfaceObject()methodofthecorrespondingIf a Global Services Application.was found, then the OPENprovidesshall retrieve thefollowingGlobalServiceparameters toinstance by invoking the Applet.getShareableInterfaceObject()method:of that Global Services Application with theclientAIDisparameter set to the AID ofthethe current applet context (i.e. therequestingoneon-cardinvoking thisentitymethod)andand theparameterisparameter set to .GLOBAL_SERVICE_IDENTIFIER;.The@param serverAID AID of the Global Services Applicationreturnsproviding the requested service, ornullif thereferencecaller of this method is requesting a uniquely registered service name.@param sServiceName service name identifying a service or a family of services.
A service name is encoded on 2 bytes,
theShareable1st byte identifyingInterfacea familyObject implementingof services and theGlobalService2nd byte identifying a service within thatinterfacefamily.IfThisthe 2nd byte ishandleset to0x00, theGlobalService interface is then returned by OPENcaller of this method is requesting atoservice of therequestingspecifiedapplet.family,but does not care exactly which service within that family.
@paramThisserverAID identifies the required Global Serviceclass defines a set of constantsApplicationFAMILY_XXXAID(ofortheisbytenull.type)@paramthatsServiceName identifies the required Global Service Service Namemay be used to build a service nameor(ofthetheshorttype)entiresuitableServiceto invoke this method as shown inFamilythe following examples:.FAMILY_CVM<8)|0x11)@return the GlobalService instance giving access to (short)((.FAMILY_HTTP_ADMINISTRATION<8)|0x00)interface objectthe requestedreferenceservice, ornullif the Global Services Application could not be found or did not provide a GlobalService instance.@see #GLOBAL_SERVICE_IDENTIFIER @see #FAMILY_CVMCVM @see #FAMILY_SECURE_CHANNEL @see #FAMILY_USSM @see #FAMILY_AUTHORITY @see #FAMILY_HTTP_ADMINISTRATION @see #FAMILY_HTTP_REPORT @see GPRegistryEntry#registerService @since export file version 1.1
Locks the card. This methodClass GPSystem, boolean setATRHistBytes(byte[], short, byte)locksshall be used to transition the card to .CARD_LOCKED Life Cycle State.
Notes:The OPENlocates theshallentry ofcheck that thecurrentApplicationapplet context in the Open Platform Registryinvoking this method has the Card LockandPrivilege.verifiesIfthatnot, theapplication has thetransitioncard lock privilegeshall be rejected.
@returntrueif the card was locked,falseotherwise.
Class GPSystem, boolean setCardContentState(byte)This methodSetssetsthe historical bytes of theATR (Answer To Reset (ATR) string.This method only updates the ATR string that is used for the contact-based IO interface (as specified by [ISO/IEC 7816] upon power-up or cold reset. The
sequenceATRofstring used for warm reset shall remain unchanged. The new historical byteswillshall be visibleonuponanextsubsequentpower-up or cold reset.
Notes:The OPENlocates theshallentry ofcheck that thecurrentApplicationapplet contextinvoking thisinmethod has theOpen Platform RegistryCard Reset Privilege andverifiesthat theapplicationbLengthishas theboth positive"CardandReset"lowerprivilegethanfor16. If not, thecurrent cardchange shallI/Obeinterface;rejected.Notes:
The OPEN is responsible for synchronizing the length of historicalhistorical bytesinin the format character (low orderFormat Characternibble of T0) of the ATR string.@param baBufferthe sourcebyte array containing the ATR historical bytes. @param sOffset offset of the ATR historical byteswithin source byte array. @param bLengththenumberlength of the ATR historical bytes.@returntrueif ATR historical bytes were set,falseotherwise.
Sets the Life Cycle state of the Application invoking this method. This method allows theClass GPSystem, boolean terminateCard()applicationApplication associated with the currentappletapplet contextto lock itself or to change its statetofrom an applicationspecific lifespecificcycle state orLife Cycle State tolockanotheritself.applicationAnspecific LifeapplicationCycle State. An Application cannot unlock itself.
using thisThe OPENmethod.shallcheckthat@paramthebStateApplication is currently in anapplicationapplication specificlifeLifecycle stateCycle State (i.e. in the range [0x07to.. 0x7F] and with3its 3 low order bits set to 1),orin particular that it is not in the .APPLICATION_LOCKEDINSTALLED(0x80)state and not currently locked. If not, the change shall be rejected.@returnThe OPEN shall check thatfalsebStateifeither encodes an application specific Life Cycle State or has its high order bit (b8) set to 1: the latter case shall be interpreted as a request from the the Application to lock itself. @param bState either an applicationinvoking this method isspecific Life Cycle Statecurrently(i.e.lockedin the range [0x07 .. 0x7F] and with its 3 low order bits set to 1), or any value having its high order bit (b8) set to 1. A value of .APPLICATION_LOCKED may be used to request locking the Application. @returntrueif theoperationLifeisCycle Statesuccessfulof the Application was changed,falseotherwise.@see #APPLICATION_INSTALLED @see #APPLICATION_LOCKED @since
- export file version 1.0: initial version.
- export file version 1.5: this method now allows the
applicationapplication associated with the current applet context to lock itself.
Class GPSystem, byte APPLICATION_LOCKEDThis methodTerminatesterminatesthe card.Notes:This method shallnotbeinvokedused tofromtransition theAppletcard to .install()CARD_TERMINATEDmethodLife Cycle State.The OPEN
locates theshallentry ofcheck that thecurrentApplicationapplet context in the Open Platform Registryinvoking this method has the Card TerminateandPrivilege.verifiesIfthatnot, theapplication has thetransitioncard terminate privilegeshall be rejected.
@returntrueif the card was terminated,falseotherwise.
The current applet context is in the Life Cycle State of LOCKED (0x80).Class GPSystem, byte CVM_ETSI_PIN_APP_1To knowifwhether an application is locked or not, a logical ANDoperationoperation shall beperformed between this constant and the current applicationlifelife cyclestate.
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_2requiredis the ETSI PIN App 1 (0x01). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_3requiredis the ETSI PIN App 2 (0x02). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_4requiredis the ETSI PIN App 3 (0x03). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_5requiredis the ETSI PIN App 4 (0x04). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_6requiredis the ETSI PIN App 5 (0x05). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_7requiredis the ETSI PIN App 6 (0x06). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_ETSI_PIN_APP_8requiredis the ETSI PIN App 7 (0x07). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte CVM_GLOBAL_PINrequiredis the ETSI PIN App 8 (0x08). @since export file version 1.5
Indicates that the required CVM interfaceClass GPSystem, byte FAMILY_HTTP_REPORTrequiredis a Global PIN (0x11).
Indicates the family of the HTTP Report Service Identifier (0x85).Application is not requested to expose this service through .getService(AID, short)@since export file version 1.3
ThisClass GlobalService, Shareable getServiceInterface(GPRegistryEntry, short, byte[], short, short)defines theinterfaceforallows requesting a Global Services Applicationto provide its actual service interface. The Global Services Application uses thisforinterface to check thea Shareable Interface Objectvalidity(SIO)ofproviding therequestactualservice.
presented byTo retrieve anon-card entity. Prior toinstanceusingof this interface, an Applicationis required to obtain a handle to the Global Services Application byshallinvoking theinvoke the GPSystem.getService()method.@since export file version 1.1
Class GlobalService, byte KEY_ACCESS_ANYThis method returns a handleGets a Shareable Interface Objectto(SIO) actually providing the requested service.
interface of a Global ServicesThe Application invoking this methodApplication.shall set theclientRegistryEntryto its own GPRegistryEntry instance.
Note:The Global Services Applicationverifiesshall verify the validity of therequestrequest according to its own securitypoliciespolicies forthisthe specifiedsServiceNameand, based on the identityof the requestingand characteristics ofon-cardtheentity and its characteristics asApplication invoking this method as registeredinby the specifiedclientRegistryEntry;,Onanda valid servicepossibly based onrequest,the data contained in theGlobalbaBufferServicebyteApplicationarray.
returnsIf thereferencerequest isofvalid, theShareable InterfaceGlobal Service ApplicationObjectreturns a SIO implementing the actual service: thisShareable InterfaceSIOObjectmay either be this GlobalService instance or another object. If the request is deemed to be invalid, the GlobalServiceServices Applicationinterfaceshall reject the request by either throwing an exception oranotherreturningnull.It is assumed that the Application invoking
Javathis methodCardis aware ofshareablethe interface;(extension of the Shareable interface) to which the retrieved SIO shall be casted in order to acces the service.Notes:
Depending on its own securityIt shall be noticed thatpolicy,an Application having the GlobalServiceRegistry Privilege could potentially invoke this method with theclientRegistryEntryparameter set to the GPRegistryEntry instance of another Application. If the Global Services Application itself has the Global Registry Privilege, it mayreject an invalid service requestexplicitly retrieve and check thebyGPRegistryEntryeither throwing an exception or justinstance of the Application invoking thisreturningmethod, by performing the following call:. @param clientRegistryEntry thenullGPSystem.getRegistryEntry(JCSystem.getPreviousContextAID())GP Registry entryGPRegistryEntryreferenceinstance ofthethe requestingon-card entityApplication.@param sServiceName a service name identifying the requested service.
A service
name is encoded on 2 bytes, the 1st byte identifying a family of services and the 2nd byte identifying a service within that family.
@paramThebaBufferGPSystem class defines a set of constantsFAMILY_XXX(of thebytetype) that may be used to build a service name (of theshorttype) suitable to invoke this method as shown in thesourcefollowing examples:@param baBuffer byte array containing additional parameters of the
(short)((GPSystem.FAMILY_CVM<8)|0x11)(short)((GPSystem.FAMILY_HTTP_ADMINISTRATION<8)|0x00)servicerequest, potentially authentication data. Must be global byte array. @param sOffset offset of the additionalrequestparameterswithin the source byte array. @param sLength length of the additionalrequestparameters.@return thespecificSIOserviceprovidinginterfacethe actualreferenceservice, ornullif the service is not available or the request was rejected.Alternatively, this method may reject the request by throwing anISOException. @exception ISOExceptionwithif the request was rejected. Although not mandatory, it is recommended to use one of the following reason codes:Alternatively, this method may reject the request by returning
- '6A88' if the specified service was not found or is not available.
- '6982' if some security conditions are not satisfied.
- '6985' if some other conditions are not satisfied.
.ISO7816nullSW_CONDITIONS_NOT_SATISFIED@exception SecurityException if the Global Services Application requires reading data frombaBufferandbaBufferis not a global byte array. @exception NullPointerException if the Global Services Application requires reading data frombaBufferandbaBufferisnull. @exception ArrayIndexOutOfBoundsException if the Global Services Application requires reading data fromand reading data would cause access of data outside array bounds.ISO7816baBufferSW@see GPSystem#getService @see GPSystem#FAMILY_SECURITYCVM @see GPSystem#FAMILY_STATUSSECURE_NOTCHANNEL @see GPSystem#FAMILY_SATISFIEDUSSM @see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_HTTP_ADMINISTRATION @see GPSystem#FAMILY_HTTP_REPORT
Key Access indicating key may be used by the Security Domain andClass GlobalService, byte KEY_ACCESS_APPLICATIONanyany associatedapplicationApplication (0x00).
Key Access indicating key may be used by any associatedClass GlobalService, byte KEY_ACCESS_SECURITY_DOMAINapplicationApplication butnotnot by theSecurity Domain (0x02).
Key Access indicating key may be used by the Security Domain but not byany associated applicationany associated Application (0x01).
This interfaceClass HTTPAdministration, void requestHTTPAdministrationSession(byte[], short, short)handlesdefinesana method to trigger a new HTTP administration sessiontriggering request.
Theobject implementing this interface shall belongTo retrieve an instance of thistointerface,the JCRE to havean Application shall use theaccessGlobalServicetoinstance,anyifobject.available,The HTTPAdministrationregistered with a serviceshallnameverifyof(GPSystem.FAMILY_HTTP_ADMINISTRATION<8|0x00).that@seetheGlobalServicemethod@seeparametersGPSystem#getServiceare@since
within- export
bounds andfile versionall1.3:objectsinitialpassedversion.in- export
as parametersfile versionare1.6:accessible from thereviewed overall description ofcaller#sthiscontextinterface.@since export file version 1.3
Request anTriggers a new administration session.
The Security Domain of thecallingApplication invokingapplicationthis method will handlethethe SCP81 (PSK TLS) security of the communication.
ThecallingApplicationapplicationinvoking this method will be notified of therequestresultexecutionof the request if it implements theinterfaceHTTPReportListenerinterface.
@param triggeringParametersthis bufferbytecontains thearray containing administrationsessionsession triggeringparameters as defined in Amendment Bparameters.@param offset offset of triggering parameters withintriggeringParameterstriggeringParameters. @param length length ofparameters withintriggeringtriggeringParametersparameters. @exceptionjava.lang.SecurityException iftriggeringParametersisnotnot accessible in the caller#'s context. @exceptionjava.lang.NullPointerException iftriggeringParametersis equalistonull. @exceptionjava.lang.ArrayIndexOutOfBoundsException ifoffsetreadingortriggeringlengthparameterswould lead tocommand would cause access of data outside array bounds.@exceptionjavacard.framework.ISOException with one of the following reason codes:
SW_WRONG_DATAifdata within triggeringParametersparameters arenotnot correctly formatted.SW_CONDITIONS_NOT_SATISFIEDifoperationthe request could notbebe processed (for examplee.g. if noSCP 81SCP81support is possible forsessionthe calling applicationcould be established).
Class HTTPReportListener, void httpAdministationSessionReport(short)An applet may implement thisThis interfacein orderdefines a method to receive a notificationon HTTPAdministrationupon completionrequest(successprocessing.orfailure) of an HTTP Administration Session.
Such an applet shall expose theAn Application that wishes to receiveHTTPReportListenersuchinterfaceaobject(s)notificationthroughshall implement the javacard.framework.Applet.getShareableInterfaceObject(javacard.framework.AID,byte)to return an HTTPReportListeneronly ifinstance when theclientclientAIDAIDparameter is set tonull, and theparameterparameter issetset to GPSystem.FAMILY_HTTP_REPORT.@since
export file version 1.3: initial version.
- export file version 1.6: reviewed overall description of this interface.
Notifies theClass HTTPReportListener, short HTTP_SESSION_ERRORappletApplication that the requestedHTTPAdministrationSessionHTTPhas beenAdministration Session successfully completed or not.
The OPENnotifynotifies theAppletApplication when theHTTPAdministrationSessionHTTP Administration Sessionendends or when the retry policy is exhausted.@param status
With following meaningEither .HTTP_SESSION_NO_ERROR: HTTPAdministration sessionEnd(failure) or .HTTP_SESSION_ERROR: retry policy ofthe HTTPAdministration session is exhausted(success).
Constant notifying thatClass HTTPReportListener, short HTTP_SESSION_NO_ERRORthe HTTPAdministartiona HTTPsessionAdministration Sessionfailsfailed.ThatTheis, the retry policy of the session is exhausted and the administrationsessionsession request is aborted.
Constant notifying thatHTTPAdministration session Enda HTTP Administration Session ended successfully
This interface definesClass Personalization, short processData(byte[], short, short, byte[], short)the interface that representsa method through which anapplet methodApplicationaccessible through the OPENmay forward input data totheanother Application's associatedSecurityandDomain.retrieveThe Applet class thatoutput data from thatwillApplication.
use the additional functionality that allows a Security DomainThis interface shall be implemented by an Application that wishes topass data toreceivethe applet and send backpersonalization data forwarded by itsApplet#sassociateddata personalization must implement this interfaceSecurity Domain and request outputting response data.TheInOPEN issuch aresponsiblescenario,of calling this new interface ifif the Application implements both theimplementedApplicationbyand theApplet toPersonalizationpersonalizeinterface,otherwisethen theinterface ApplicationSecurity Domain shallbe called. See also section 7.3.3 ofuse theGlobalPlatform Card SpecificationPersonalizationv2interface.2 -Personalization
support.@seeApplication @since export file version 1.2
ThisProcessesmethod processes Applicationapplication specific data received from anotherentityonthe-card entity.If
this other entity is thethe Application invoking this methodApplication'sisassociateda Security Domain, thisdata is the APDUthen it shall bebuffer.assumedNotesthat:
DuringBoth theinvocationinBuffertheandJavaoutBufferCard VM performsbyte arrays areaglobalcontext switchbyte arrays;- The
appletdata forwarded by the Security Domain isresponsible fora STOREmanagingDATA command. ThesOffsetparameter locates theatomicityclass byte ofits ownthe commanddata;and theAssLengthaparameter indicates the length of the entire command (i.e. header + data field).- The
Security Domainimmaterialwillofsend back to the off-card entity the output data written by the ApplicationLifetooutBuffer.Cycle- Any
State can invokeexception thrown by this method will be rethrown by the Security Domain,ithence will be converted to and returned as a response status word to the off-card entity. If the exception is an ISOException, then theresponsibilitystatusofword will be theapplet to ensurereason code of thatitsexception.Otherwise,current Life Cycle Statea status word ofis'6F00'validwillforbe returned.Notes:
@param inBuffer
- Upon invocation of this
operationmethod, the Java Card VM performs a context switch.- As the
appletApplication is not the currently selected Application,itit should notuseattempttheto access transient memory of typeCLEAR_ON_DESELECTwhen creating transientduring the processingarraysof this method.IfThethe method throws an ISOExceptionApplication is responsible for managing theJavaCardatomicruntime environment sendsmodification of its ownthedata,associatedifreasonneeded.code- As
as the response statusthis method may beinstead.invokedIf the Exception thrown doesby a Security Domain immaterial ofnotthe Application'sextendsinternalISOExceptionstate, thereason codeApplication isISO7816.SW_UNKNOWN.responsibleThefor ensuringpersonalizationthat its internal state is validsession remains openfor this operation.the sourcebyte array containingtheinput data.expected by theMust be aapplet.globalThis buffer must bebyteglobalarray. @param inOffsetstartingoffsetwithin source byteof input dataarraywithininBuffer. @param inLength length of input data. @param outBufferthe outbyte array wheretheoutput dataexpected by the Off-Card Entityshall besetwritten.MustThis bufferbe ashallglobalbe globalbyte array. @param outOffsetstartingoffsetwithin outwhere outputbytedata shall be written withinarrayinBuffer. @returnThethe number of bytessetwritten tooutBuffer. @exceptioninoutBuffer atSecurityException ifoutOffsetinBufferoroutBufferis not a global byte array. @throws Exceptions thrownexception NullPointerException ifareinBufferApplicationorspecificoutBufferisnull. @exception ArrayIndexOutOfBoundsException if reading intput data or writing output data would cause access of data outside array bounds.
This interface definesClass SecureChannel, short decryptData(byte[], short, short)an interface to bebasic Secure Channel services used to manage entity authentication and protect APDU commands and responses. It is typically exposed by a Security Domain to its associated Applications.Using
anApplication that may want toinstance of this interface requiresdelegateno knowledge of thehandlingunderlyingofprotocols,entityalgorithmsand secrets used to perform entity authentication and provide integrity and confidentiality of APDUsecuritycommands and responses, which only need to be known by the provider of the instance.An
Application that wishes to delegate such activities to its associated Security Domain shall retrieve a SecureChannel instance provided by its associated Security Domain using the GPSystem.getSecureChannel method. On some implementations, this SecureChannel instance may also be retrieved using the GPSystem.getService method.
ThisIf the card supports logical channels, this interface isdesignedresponsibletofor correctlyoffer interoperability to the Application in that it requires no knowledgehandling any indication of a logical channel number present in the class byte oftheAPDUmechanismscommands.usedIn particular, it shall be able toperform the authenticationverify and removeor(i.e.ofunwrap) theschemeprotectionused(ifforany) of an APDUsecurity and shall allow an Application to interfacecommand without altering such indication of a logical channelcorrectlynumber.withUpon successful initialization of a Secure Channel Session, the implementation shall establish both a compulsory Session SecurityDomainLevel and a Current Security Level:
immaterialThe compulsory Session Security Level is the Security Level negotiated during the initialization of the mechanismssession,or schemesthat shallusedapply as a minimum security requirement during the entire Secure Channel Session.Prior to using thisThe compulsory Session Security Levelinterface,shallanonlyApplicationbe reset upon (full) termination of the Secure Channel Session.The Current Security Level isrequiredthe security requirement that shall indeed apply toobtainAPDU commandsa(and responses) during thehandlesession and is initialized toits associated Securitythe same valueDomain#sasSecureChannel interface object by invokingthe compulsory Session Security Level at the beginning of theGPSystemsession.getSecureChannelThe Current Security Level may be subsequently updated (e.g. R-MAC or not)method.uponThe SecureChannel interface shall only besuccessful processing of some commands specific toexposedthe underlying security protocol or upon successfulthroughinvocation of theGPSystemSecureChannelx.getSecureChannel()setSecurityLevel method.(ifInsupported),all cases wherebut shall never get below theApplicationminimumpassesrequirement defined by theAPDUcompulsory Session Security Level.bufferThe Current Security Level, asawell as any informationparameterrelating to the Secure Channel Session (except the compulsory Session SecurityDomainLevel),the class byteshall be resetupon abortion or termination of theAPDU shallSecure ChannelnotSession. See Card Specification v2.2.1 section 10.2.3 for details about abortion and termination of a Secure Channel Session.Until it is aborted, a Secure Channel Session shall
bemodifiedbound to the following information:.
- the Logical Channel on which it was initiated: The session only exists on the Logical Channel on which it was initiated
ThisIf anensuresApplicationthatinvokes this interface from another Logical Channel, then theSecurityinterfaceDomainshall behave as if no Secure Channel Session was currentlyknowsopen but thelogical channelexisting sessionnumbershall neither be aborted nor be terminated. For resource management reasons,Ifattempts to open another Secure Channel Session from another Logical Channel (i.e. concurrently to thecardexistingsupportsone(s))logicalmaychannels,beitrejectedisby the implementation.the responsibility ofApplication that initiated theSecuritysession:DomainAny call performed tocorrectlythismanageinterface by another Application from thelogical channel information whenLogical Channel attached to theprocessingsession shall be rejected with an exception. For example, this may happen if this other Application somehow obtained a reference to this interface using theAPDUsharing mechanism. @sinceexport file version 1.0: initial version.
- export file version 1.6: reviewed overall description of this interface.
Class SecureChannel, short encryptData(byte[], short, short)ThisDecryptsmethod is used tosensitivedecryptuser datalocated in the input buffer.
Notes:ProcessingThethis method shall complydecryption algorithm and cryptographic key used tothedecryptrulesdata,of the Secureas well asChannelany paddingProtocolmethod,implemented by the Securityare known implicitly and dependDomain;onThetheSecurity Domainunderlying securityimplicitlyprotocol.
knowsIf thekey toCurrentbe used forSecurity Level isdecryption.NO_SECURITY_LEVELTheorSecurity Domain is implicitly aware ofthe necessary cryptographic keys are notanyavailable,padding that may be present in thethen this method shall throw an exceptiondecrypted(see below).Otherwise,
the dataand this isshall be decrypteddiscarded.andThethe clear text datareplacesshall replace thecipheredencrypted data within thebytebaBufferbyte array. Theremovalremoval of padding may cause the length of the clear textdatadata to be shorter than the length of thecipheredencrypted data.Theapplet is responsible for checking the integrity of the decryptedAny failure in the decryption or padding removal process shalldataresult in an exception being thrown (see below).
Notes:
A Secure Channel Session shall be opened andThe Application is responsible for removing application specificapadding,sensitiveifdataany.decryptionForkeyexample,shall beif theavailable;underlyingThissecuritymethodprotocol isfailsSCPif'02',a Secure Channel Sessionthen no padding method is defined and this method will notopenremove any(i.epadding.SessionSecurityThe Level =Application isNO_SECURITY_LEVEL)responsibleor iffor checking thecorresponding sessionintegritykeys are not availableof the decrypted data.@param baBuffer byte array containing thesource bytedata thatarrayshall be decrypted. @param sOffset offsetwithinof thesource byte arraydatato start the decryptionthat shall be decrypted. @param sLengththenumberlength ofbytesthetodatadecryptthat shall be decrypted.@returnThelength of theclear textdecrypted data, with any padding removed if a padding method is defined for the underlying security protocol.@exception ISOException with one of the following reason codes (other reason codes specific to the underlying security protocol may be returned):@exception
ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED'6985' ifa Secure Channel Session has not been openedthere is no Secure Channel Session currently open.ISO7816.SW_WRONG_LENGTH'6700' if the length of the datatothat shall be decrypted is not valid (e.g. underlying algorithm requires data to be block-aligned and input data are not).java.lang.SecurityException ifbaBufferis not accessibleinin the caller#'s contexte.g.baBufferis not a global array nor an array belonging to the caller context. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading user data or writing decrypted data would cause access of data outside array bounds.
Class SecureChannel, byte getSecurityLevel()ThisEncrypts sensitive user data.If this
method isused to encrypt data located innot supported by the implementation or theinput buffer.underlyingNotes:protocolProcessingdoesthis method shall comply to thenot define any sensitive data encryptionrulesmechanism,of the Secure Channel Protocol implemented by theit shall do nothing and simply throw an exceptionSecurity(seeDomain;below).The
Security Domain is implicitly awareencryption algorithm and cryptographic keyofused to encrypt data, as well as any paddingthatmethod, aremustknownbeimplicitly andapplied todepend on theclearunderlyingtextsecuritydataprotocol.
prior to encryption according to theIf the Current Security Level isSecure.NO_SECURITY_LEVELChannelorProtocol;theThenecessarySecuritycryptographic keysDomainareimplicitlynot available, then this method shall throw an exception (see below).
knowsOtherwise, thekey todata shall beusedpaddedfor(NOTE:encryption.dependsTheoncipheredthe underlying protocol) and encrypted and the encrypted datareplacesshall replace theclearclear text data within thebaBufferbyte array.ATheSecure Channel Sessionaddition of paddingshallmay cause the length of the encrypted data to beopened and a sensitivelonger than the length of the clear text data.encryptionkeyAny failure in the padding or encryption process shallberesultavailable;in an exception being thrown (see below).Notes:
ThisThemethodApplication is responsible for addingfailsapplication specific padding, ifaneeded.SecureForChannelexample,Sessionif the underlying security protocol isnotSCPopen'02',then(i.e.noSession Security Level =padding method is definedNO_SECURITY_LEVEL)andor if the corresponding sessionthis method by itself willkeysnot add any padding, which may lead to an exception being thrown (see below) if input data are notavailableblock-aligned.@param baBufferthebyte array containing the datatothat shall beprocessedencrypted. @param sOffset offsetwithinof thebyte arraydatato start the encryptionthat shall be encrypted. @param sLengththenumberlength ofbytesthetodataencryptthat shall be encrypted.@returnThelength of the encrypted data.@exceptionArrayIndexOutOfBoundsExceptionISOExceptionwithifoneenciphering produces data outside arrayof the following reason codesbounds.(otherreason@exceptioncodesISOException withspecific to thefollowingunderlyingreasonsecurity protocol may becodereturned):@exception
ISO7816'6982' if this method is not supported by the implementation.SW_SECURITY_STATUS_NOT_SATISFIED- '6985' if
athere is no Secure Channel Session currently open.- '6700' if the length of the data that shall be encrypted
is notopenvalid (e.g. underlying algorithm requires data to be block-aligned and input data are not).java.lang.SecurityException ifbaBufferis not accessibleinin the caller#'s contexte.g.baBufferis not a global array nor an array belonging to the caller context. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading user data or writing encrypted data would cause access of data outside array bounds.
Class SecureChannel, short processSecurity(APDU)ThisGetsmethod returns, from the requester's standpoint,the Current Security Levelcoded as a bit-map according to Table 10 1 indicating whether entity authentication has occurred and what level of security is currently applicable to command and response messages processed by the unwrap() and wrap() methods.Notes:AppletsAn Applicationmustshall invoke this method to ensure thatapplication specific security requirements have beenitspreviously met or will beown specific security requirements are enforced bythe SecuritythisDomaininterface.MoreItthan one level of security may be active and theseshall also take into account that the Current Security Level may change duringathe Secure Channel,Session (e.g.anR_MACsessionmay beinitiatedenabled or disabled during a C_MACMAC session).Notes:
The Current Security Level, may be different atas returned by thisthemethod, maysame timebe different for an Application invokingthe method and itsassociatedassociated Security Domain depending on theSecureunderlyingChannel Protocolsecurity protocol andthethe authenticated off-card entity's Application Provider ID (e.g. it maybebe ANY_AUTHENTICATEDfor the application and AUTHENTICATED for itsassociatedassociated Security Domain, and vice versa).@return ThecurrentCurrent Security Level, which is a combination of one or more the following constants:
Processes security related APDU commandsClass SecureChannel, void resetSecurity(). This,methodthat isused by an applet to process, APDU commandsthat possiblyrelatingrelateto thesecurity mechanism usedunderlyingby the SecuritysecurityDomainprotocol.As the intention is to allow an Application to
be associatedusewith aSecureSecurity DomainChannel services without having any knowledge of thesecurity mechanisms used by theunderlyingSecuritysecurityDomainprotocols,thetheappletApplication mayassumesassume that APDU commands that it does not recognizeareare part of the securitymechanismprotocol and will be recognized bythethisSecuritySecureChannelDomaininstance.TheTherefore, theapplet canApplication may either invokethisthis method prior to determiningif it recognizes the command or onlyinvokeinvoke this method for commands it does not recognize.The method sets the compulsory Session Security Level that is established at Secure Channel initiation and which is required for the whole Secure Channel Session.OnInsuccessful initialization of the Secure Channel Sessionturn,the Current Security Level is set to the same value as the compulsory Session Security Level.thisThe Current Security Levelmethod will throw anisISOExceptionupdatedif(R-MACitordoes not) on the successfulprocessing ofrecognize theBEGINAPDUR-MACcommandSESSION / ENDas a securityR-MACrelatedSESSION commandsAPDU command.
Notes: Processing this method shall comply to the rulesof the Secure Channel Protocol implemented by the Security Domain; TheThis method is responsible for receiving the data field ofcommandsAPDU commands that are recognized; The appletis responsible for recognizing commands(i.e. thatthe method refusedbelong toprocess ('6E00'theandsecurity'6D00'protocol);.The applet is responsible for outputting status bytesreturnedWhendue to theprocessingof instructions recognizedabycommand,thethis method; If response dataisshallpresent,writethisresponse datawill be placedinthetheAPDUbuffer at offset ISO7816.OFFSET_CDATA.The returnor returncodea status wordindicatesunder thelengthformandofthean ISOException.appletTheisApplication is responsible for outputtingthissuch response data.and/or status word.
@param apdu the incomingAPDUobject.@return the number of bytes to be output (i.e. length of response data). @exception ISOException with a reason code reflecting some error detected by the underlying security protocol, or with one of the followingreasonreason codes(otherifsecurity mechanism relatedthe APDU commandstatusis notwords may berecognized and doesreturned)not relate to the underlying security protocol:
ISO7816.SW_CLA_NOT_SUPPORTED'6E00' if the class byte of the command is not recognized bythethis method.ISO7816.SW_INS_NOT_SUPPORTED'6D00' if the instruction byte of the command is not recognized bythethis method.
Class SecureChannel, short unwrap(byte[], short, short)This method is used to reset all information relating toTerminates the current Secure Channel Session.ItThis method resets both the compulsory Session Security Level andthethe Current Security Level to .NO_SECURITY_LEVEL,and resets allterminatesinformation relating to the current Secure Channel Sessionand(e.g.erasesinternalallstates, session keys).
Notes: It is stronglyrecommended that applets using the services of a Security Domain invoke this method in theThis method shall not fail and shall simply return if no Secure Channel Session has beenAppletinitiated.deselect()
method;Notes:
The Security Domain will reset all information relating to the current SecureItChannel,isi.e.recommendedall Secure Channel sessionthat Applications using thiskeys,interfacestate information and security level information will beinvoke this method in the implementation of theirerasedApplet.methodThisdeselect()shall not fail if no Secure Channel has been initiated.
Class SecureChannel, short wrap(byte[], short, short)ThisVerifiesmethod is used to processandverifyremoves thesecuresecuritymessagingprotection of an incomingcommandAPDU command according tothe security level andtheSessionCurrent Security Level.
ofIf thecurrentCurrentSecure ChannelSecurity LevelSessionis .NO_SECURITY_LEVELNotes:andProcessingisthis method shall comply to the rulesdifferent from the compulsory Session Security Levelof(i.e.thea previous Secure ChannelProtocol implementedSessionbywastheabortedSecuritybutDomain;notIffullyNO_SECURITY_LEVELterminated),AUTHENTICATEDthenorthisANY_AUTHENTICATEDmethodonly isshall throwindicated,anexceptionwhen(seecomplyingbelow).
toIf theSecureclassChannelbyte does not indicate secure messaging (according toProtocolISO/IECrules7816-4), then this methodwillshall not attemptany secure messagingtoprocessing on the incomingverify and remove anycommand,securityprotection: the incoming commandwillshall remain as is withinthetheincomingbaBufferAPDU objectbyte array and the returned lengthof the #unwrapped# datashallisbe settoto the valueof thesLengthparameter, otherwise a security error is returned;.If the class byte
does not indicateindicates secure messaging (according to ISO/IECIEC 7816-4), then this methodwill notshall attemptany secure messaging processingverifying and removing the securityonprotection according to theincoming commandCurrent SecurityandLevel:the
- If
incoming command will remainCurrent Security Level isas.NO_SECURITY_LEVEL,is.AUTHENTICATEDwithinorthe.ANY_AUTHENTICATED,incoming APDUthen thisobject.methodWhen complying with the Secureshall not attempt to verify andChannelremove anyProtocol rulessecurity protection, thereturned lengthincomingof thecommand will#unwrapped#remaindataas isset towithin thevaluebaBufferof thebyte arraysLength(withparameter otherwise a securityclass byte indicating secureerrormessaging)isandreturned;theThereturnedapplet is responsible for receivinglength shall be set to thedata fieldvalue of thecommand;sLengthparameter.CorrectIncorrectsecure messaging processingverification and removal of theunwrap()securitywillprotection shall result inthe incomingancommandexception beingreformattedthrownwithin(see below) and theincoming APDU object withcurrent Secure Channel Session being aborted: alldatainformation relating to thesecure messaging removed. A reformatted case 1 orSecurecaseChannel2Session,command will include an Lcexcept the compulsory Session SecuritybyteLevel,set toshall bezero;reset.If R_MAC is indicated in theCorrectCurrent Security Levelverification and removal of theSecure Channel Session, oncesecuritysecure messaging processing ofprotection shall result in the incomingcommandhas successfully completed,beingR-MACreformattedcomputation onwithin thethebaBufferreformatted commandbyte array (ia.ek.after all the data relating to secure messaging has been removed) will be initiateda.If no secure messaging processing was required for the incomingunwrapped command, R-MAC computation will).be initiated on the unmodified incomingA reformatted case 1 or case 2 command,appended with ashall include an Lc byteof zero in eventsetoftoa'00'.case1Notes:
orThe case 2Application iscommand;implicitlyIncorrectresponsibleprocessing offor receiving theunwrap method willdataresult infield of theinformationincompingrelating toAPDUthe current Secure Channel being resetcommand prior to invoking this method.This method doesDependingnot fail ifona Secure Channelthe underlying securitySessionprotocol,isifnotR_MACopenis(thatindicatedis,bywhen Sessionthe Current Security Level= NO_SECURITY_LEVEL) or if the corresponding,sessionR-MACkeys are notcomputation may beavailable;initiatedTheonmethod fails if thethe reformatted command once secure messagingofprocessing of the incoming commandis nothas successfullyverified or does not matchcompleted.the Current Security LevelIf no secure messaging(asprocessingdefined either aswas required for thecompulsory Session Security Level set at initializationincomingofcommand,theR-MACSecure Channel Session or ascomputation would be initiated on theCurrent Security Levelunmodifiedsetincomingbycommand,theappendedsetSecurityLevel()withmethod).aIf theLc byte ofmethod'00'fails,in theCurrent Security Level is reset toeventNO_SECURITY_LEVEL,ofbut not the compulsory Session Security Levela case 1 or case 2 command.@param baBufferthe source ofbyte array containing thedata toincomingbe unwrappedAPDU command. @param sOffsettheoffsetwithin baBufferof theAPDU dataincomingto unwrapAPDU command, i.e.theoffset ofthe command headerthe class byte. @param sLengththelength of theAPDU dataincomingto unwrapAPDU command, i.ethelength ofthethe entire APDU command (headerand+ data field). @returnthelength of the reformatted (unwrapped)dataAPDU command, i.ethelengthofof the entire APDU command (headerand+ data field). @exception ISOException with one of the following reasoncodecodes (otherothersecurityreason codes specific tomechanism related status wordsthe underlying security protocol maybebe returned):
ISO7816'6985' if the Current Security Level is .SWNO_SECURITY_STATUS_NOT_SATISFIEDLEVELif secure messaging verificationbut the compulsory Sessionfailed.SecurityISO7816Level is different from .SW_CLANO_NOTSECURITY_SUPPORTED classLEVEL,bytethat is, a previous Secure Channel Session was aborted but notrecognizedfullybyterminated.the- '6982' if this method failed verifying or removing the security protection of the incoming APDU command.
@exceptionjava.lang.SecurityException ifbaBufferis not accessibleinin the caller#'s contexte.g.baBufferis not a global arraynornor an array belonging to the caller context. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading the incoming APDU command would cause access of data outside array bounds.
Class SecureChannel, byte ANY_AUTHENTICATEDThis method applies secure messagingComputes and adds security protection tothe currentan outgoingresponseAPDU response according to the Current Security Level.If the Current Security Level is .NO_SECURITY_LEVEL and
is different from the compulsory Session Security Levelof(i.e.thea previous Secure Channel Session.Notes:wasProcessingabortedthis method shallbut not fullycomplyterminated),to the rules of the Secure Channelthen this method shall throw an exceptionProtocol(see below).
implementedOtherwise,by the Securitythis method shallDomain;attemptThiscomputingmethod attempts secure messaging processing ofand adding a security protection to thecurrentoutgoingresponsemessage accordingwhento the Current SecurityLevelLevelindicates(e.g. .R_MAC and/or .R_ENCRYPTION;). If theCurrentCurrent Security Level does notindicate R_MACrequireand/oranyR_ENCRYPTION,protectionwhen complying withfor APDU responsesthe(whichSecure Channel Protocolincludes the case whererules,therethis method will do no processingis no Secure Channel Session currentlyandopen), the outgoing response messagewillshall remain as is in theAPDU object.withintheThebaBufferreturned length ofbyte array and the#wrapped#returneddatalengthisshall be set tothea value ofthe(sLength,parameter minus- 2)(indicating the statusbytes arenono longer present at the end of the returned data);. Notes:
The appletApplication is responsible for appending the expected statusbytesbytes at the end of the response data prior to invoking this method in orderforfor them to beprotected by secure messaging;. Thereturned data does not include thestatusbytes; The method fails if the secure messaging of the incoming command is not successfully verified or does not match the Current Security Level(as defined either as the compulsory Session Security Level set at initialization of the Secure Channel Session or as the CurrentshallSecurity Level setbe subsequently removed bythe setSecurityLevel() method). If the method fails, the Current Security Level is reset to NO_SECURITY_LEVEL, but not the compulsory Session Security Level; Thisthis methoddoes not fail if a Secure Channel Session is not open (that is, when Session Security Level = NO_SECURITY_LEVEL) or if the corresponding session keys are not available.@param baBufferthe source of thebyte array containing response datato(includingbethewrapped.expected status bytes). @param sOffsettheoffsetwithin baBufferoftheresponse datato wrap. @param sLengththelength oftheresponse datato wrap. Notes: The length Li of the Response Data Field is automatically calculated by the Security Domain and prepended to(including theResponse Data Field for computation ofexpectedthestatusR-MACbytes).@returnthelength of the reformatted (wrapped)data.response@exceptiondata,ISOExceptionwithifsecuritysecurity mechanism relatedinformation added and statuswords might be returned. @exception ArrayIndexOutOfBoundsException if wrapping produces data outside arraybytesboundsremoved.@exceptionjava.lang.SecurityException ifbaBufferis not accessibleinin the caller#'s contexte.g.baBufferis not a global array nor an array belonging to the caller context. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if writing security information inbaBufferwould cause access of data outside array bounds.
Entity Any Authentication has occurred (0x40).Class SecureChannel, byte AUTHENTICATEDNote:
Authenticated- The authenticated entity is not the Application Provider of the Application.
The- Entity Authentication and the level of security that will be applied by the .wrap and .unwrap methods are not necessarily related. A Security Domain, by default, could verify the MAC on any command passed as a parameter in the .unwrap method without entity authentication previously having occurred.
Entity Authentication has occurredClass SecureChannel, byte C_DECRYPTIONas Application Provider (0x80).Note:
The .unwrap method will decrypt incoming command data (0x02).Class SecureChannel, byte C_MACNote:
- Command data decryption could be indicated along with entity authentication and one or more levels of security.
The .unwrap method will verify the MAC on an incoming command (0x01).Class SecureChannel, byte NO_SECURITY_LEVELNote:
- MAC verification could be indicated along with entity authentication and one or more levels of security, e.g. a value of '03' indicates that while entity authentication has not occurred, the .unwrap method will decrypt the command data of incoming commands and verify the MAC on incoming commands.
Entity Authentication has not occurred (0x00).Class SecureChannel, byte R_ENCRYPTIONNote:
- Entity Authentication and the level of security that will be applied by the .wrap and .unwrap methods are not necessarily related. A Security Domain, by default, could verify the MAC on any command passed as a parameter in the .unwrap method without entity authentication previously having occurred.
- The .wrap and .unwrap methods will not apply any cryptographic processing to command or response data.
The .wrap method will encrypt the outgoing response data (0x20).Class SecureChannel, byte R_MACNote:
- Response data encryption could be indicated along with entity authentication and one or more levels of security.
The .wrap method will generate a MAC for the outgoing response data (0x10).Note:
- MAC generation could be indicated along with entity authentication and one or more levels of security, e.g. a value of '91' indicates that entity authentication has occurred, that the .unwrap method will verify the MAC on incoming commands and that the .wrap method will generate a MAC on outgoing response data.
ThisClass SecureChannelx, void setSecurityLevel(byte)definesinterface is aninterface which extendsextension of the SecureChannelInterface and includes ainterface that defines one supplementary method.Seeto updateSecureChanneltheinterfaceCurrentforSecurityaLeveldescription of the underlying interfaceduring a Secure Channel Session.
Prior to using thisAn Application that wishesinterface,toan Applicationuse theisSecureChannelxrequired tointerface shall obtain ahandlereference toitsaassociatedSecureChannelSecurityinstanceDomain'sandSecureChannelxtryinterface object by invokingto cast it to theSecureChannelxGPSysteminterface.getSecureChannel() method andcastingWhether thereturnedobjectsobject to typereturned by theSecureChannelxGPSystem.The SecureChannelxgetSecureChannelInterface shall be implementedmethod also implement thebySecureChannelxa Security Domaininterface is implementationcompliantdependent,tohowever, thisversion ofmaythe specification and the corresponding object reference shallbe expressed as a requirement in specific GlobalPlatform configurationbedocuments.exposed@sincethrough
the- export
fileGPSystem.getSecureChannel()versionmethod1.1:@seeinitialSecureChannelversion.@since- export file version 1.
16: reviewed overall description of this interface.
This method updatesUpdates the Current Security Levelfor.all subsequent invocations ofIf this method iswrap()notandsupportedunwrap()bythemethods,implementationexcept when Secure Channel isor the underlying protocol does notactive or was aborted duringdefinethe same Applicationany sensitive datasession.encryptionCurrentmechanism,Security Level is coded as ait shall do nothing and simplybit-mapthrowaccording toan exceptiontable(see10-1below).The
currentCurrent Security Level cannot be setbelow the compulsorySessionSession Security Level,butybut only equal or above.The Current Security LevelIt may beincreasedoror decreased during a Secure Channel Session as long as it is at leastequalequal to the compulsorySessionSession Security Level.
Notes:ThisIfmethod fails if a Securethe Current Security Level isChannel.NO_SECURITY_LEVELSession is notor the cryptographicopen,keysifrequired by thecorresponding session keys are notnew Current Security Level are not available,or ifthen thisthemethod shall throw an exception (see below).The new
Current Security Levelis equal toshall apply forNO_SECURITY_LEVELall subsequent invocations of SecureChannel.wrap and SecureChannel.unwrap methods, except when there is no current Secure Channel Session.@param bSecurityLevel
theThe new Current Security Level,to bewhich shallseta combination of one or more the following constants:.R_ENCRYPTION @exception ISOException with one of the following reason codes (otherothersecurityreason codes specific tomechanism related status wordsthe underlying security protocol maybebe returned):
ISO7816'6982' if this method is not supported by the implementation.SW_CONDITION_NOT_SATISFIED- '6985' if there is no Secure Channel Session currently open or if the new Current Security Level does not comply with (i.e. goes below) the compulsory Session Security Level.
ThisClass SecureChannelx2, short processSecurity(byte[], short, short, short)defines an interface which extendsinterface is an extension of the SecureChannel interfaceInterface and overrides thethat defines one supplementary methodprocessSecurity().overridingSeethe SecureChannelinterface for a description.processSecurityofmethod.
the underlyingAn Applicationinterface.thatPriorwishes tousingusethisthe SecureChannelx2 interface,an Application is requiredshall obtain a reference toobtainahandleSecureChannelto its associatedinstance and tryto castSecurityitDomain'sto the SecureChannelx2 interface.object by invokingWhether the objectsthereturned by the GPSystem.getSecureChannel()methodandalsocastingimplement thereturned objectSecureChannelx2to typeinterface isSecureChannelx2.implementationThedependent,SecureChannelx2however,Interface shall be implemented bythis may be expressed as aSecurity Domainrequirementcompliantinto thisspecificversion ofGlobalPlatform configurationthedocuments.specification@sinceand
the- export
corresponding objectfile versionreference1.4:shallinitialbeversion.exposed- export
through the GPSystemfile version 1.getSecureChannel() method @see6:SecureChannelreviewed@sinceoverallexport file version 1description of this interface.4
Processes security related APDU commands. This,methodthat isused by an applet to process, APDU commandsthat possibly relaterelating to thesecurity mechanism used by theunderlyingSecurity Domainsecurity protocol.As the intention is to allow an Application to be associated
with a Security Domain without having any knowledge of the security mechanisms used by the SecurityDomain, the applet assumes that APDU commands that it does not recognize are part of the security mechanismThisand willmethod shall berecognizedusedbyin theSecurity Domain. The applet can either invoke this method prior to determining ifsameit recognizesway as thecommand or only invoke this method for commands it does not recognize. TheSecureChannel.processSecurity methodsets the compulsory Session Security,Levelexcept thatis established at Secure Channel initiation and which is required forthewhole Secure ChannelincomingSession. On successfulAPDUinitialization ofcommandthe Secure Channel Sessionshall be read from,andthe Current Security Level is setany response data shall be written tothe same value as the compulsory Session Security Level. The Current Security Level is updated (R-MAC or not) on the successful processing of the BEGIN R-MAC SESSION /theEND R-MACbaBufferSESSION commandsbyte array.Notes:
Processing this method shall comply to the rules of the Secure Channel Protocol implemented by the Security Domain;- The applet is implicitly responsible for
setting command header andreceiving the datafieldfield ofcommands to process intheinput buffer; The applet is responsible for recognizing commands thatincompingthe method refusedAPDU command prior toprocess ('6E00'invokingandthis'6D00');method.The applet is responsible foroutputtingstatus@parambytes returned due tobaBuffer byte array containing theprocessing of instructionsincomingrecognized by theAPDUmethod;command.If response data is present, this data will@parambe placed insInOffset offset of thebaBufferincoming APDUbuffercommand,ati.e. offsetspecified byof thesOutOffsetclass byte.The return code indicates@paramthesInLength lengthandof theapplet is responsible forincomingoutputtingAPDUthiscommand,datai.elengthof@paramthebaBuffer the sourceentire APDU commandand(headerresponse byte+ dataarrayfield).@paramsInOffsetsOutOffset offset withinthebaBuffersource byte arraywhere response datato(ifstartany)the security processingshall be written.@param sInLengthreturn the number of bytes toprocess. @parambesOutOffsetoutputoffset(i.e.within thelength of responsebytedata).array@exceptionto start theISOException with aresponse.reason@returncodethe number of bytes to be outputreflecting some error detected by the underlying security@throwsprotocol,ISOExceptionor with one of the followingreasonreason codes(otherifsecurity mechanismthe APDUrelatedcommand isstatus words may benot recognized and doesreturned)not relate to the underlying security protocol:@exception
ISO7816.SW_CLA_NOT_SUPPORTED'6E00' if the class byte of the command is notrecognizedrecognized bythethis method.ISO7816.SW_INS_NOT_SUPPORTED'6D00' if the instruction byte of the command isnotnot recognized bythethis method.java.lang.SecurityExceptionifbaBufferis not accessibleinin the caller#'s contexte.g.baBufferis not a global arraynornor an array belonging to the caller context. @exception NullPointerException ifbaBufferisnull. @exception ArrayIndexOutOfBoundsException if reading the incoming APDU command would cause access of data outside array bounds.